;*****************************************************
; 	Copyright (C) SEIKO EPSON CORP. 1997-2001
;	All rights Reserved
;
;	File name : strcpy.s
;	Function  :
;	       This is strcpy function
;	Revision  :
;		1997/03/14	M.Kudo start
;		2001/12/06	T.Tazaki for GNU33(Linux)
;*****************************************************

;*****************************************************
; strcpy
;	string copy from src to dest until 0 terminate
;
; arguments : %r6:dest addr, %r7:src addr (0 terminate string)
; return    : %r4:dest addr
;*****************************************************

	.section .text
	.align 1
	.global strcpy
	.type	strcpy,@function

strcpy:
	ld.w 	%r4, %r6		; return dest add

strcpy_loop:
	ld.ub	%r10, [%r7]+	; copy src 1 byte to dest
	ld.b	[%r6]+, %r10
	cmp		%r10, 0		; continue until 0 terminate
	jrne	strcpy_loop
	ret

